[%- pagetitle = 'PLUGIN_SOCIALMUSICDISCOVERY' | string; pageicon = 'PLUGIN_SOCIALMUSICDISCOVERY' -%]

[%- pwd_list = BLOCK -%]/
	<a href="[% webroot %]plugins/SocialMusicDiscovery/index.html?player=[% player | uri %]">[% "PLUGIN_SOCIALMUSICDISCOVERY" | string %]</a>
[% IF pluginSocialMusicDiscoverySmdFrontendJar %]
	(<a href="[% webroot %]plugins/SocialMusicDiscovery/fullwindow.html?player=[% player | uri %]" target="_blank">[% "PLUGIN_SOCIALMUSICDISCOVERY_SEPARATE_WINDOW" | string %]</a>)
[% END %]
[% END -%]
[% PROCESS pageheader.html %]
[% IF pluginSocialMusicDiscoverySmdFrontendJar %]
<script type="text/javascript" src="http://java.com/js/deployJava.js"></script>
<script type="text/javascript">
    var attributes = {
        code:"org.apache.pivot.wtk.BrowserApplicationContext$HostApplet",
        width:"100%",
        height:"400"
    };
    var libraries = [];
    libraries.push("html/[% pluginSocialMusicDiscoverySmdFrontendJar %]");

    attributes.archive = libraries.join(",");

    var parameters = {
        codebase_lookup:false,
        startup_properties:"smd-server.host=[% host.match('([^:]*)').0 %]",
        application_class_name:'org.socialmusicdiscovery.frontend.SMDApplication'
    };
    var javaArguments = ["-Dsun.awt.noerasebackground=true",
        "-Dsun.awt.erasebackgroundonresize=true" ];

    parameters.java_arguments = javaArguments.join(" ");

    deployJava.runApplet(attributes, parameters, "1.6");
</script>
[% ELSE %]
[% "PLUGIN_SOCIALMUSICDISCOVERY_FRONTEND_MISSING" | string %]
[% END %]
[% PROCESS pagefooter.html %]
